<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./css/bootstrap.min.css">
    <script src="./js/jquery.min.js"></script>
</head>
<body>
    <form action="/test">
        <input type="text" name="tname" id="tid">
        <input type="password" name="pname" id="pid">
        <input type="submit" value="提交">
    </form>
    <script>
        $(function(){
            $('form').submit(function(e){
                e.preventDefault();
                var data = $(this).serialize();
                console.log(data);
            })
        })
    </script>
</body>
</html>